package proyectos.cibertec.web.util;

import java.io.Serializable;
import java.util.Map;

import javax.faces.context.FacesContext;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

@Scope("session")
@Controller("guestPreferences")
public class GuestPreferences implements Serializable {

	private static final long serialVersionUID = 1900371148722390735L;
	
	private String theme = "home";

	public GuestPreferences() {
	}

	public String getTheme() {
		Map<String, String> params = FacesContext.getCurrentInstance()
				.getExternalContext().getRequestParameterMap();
		if (params.containsKey("theme")) {
			theme = params.get("theme");
		}

		return theme;
	}

	public void setTheme(String theme) {
		this.theme = theme;
	}
}